package jym.tan.movielibrary.factory;

import jym.tan.movielibrary.component.listener.MovieSearchResultTableSelectionListener;
import jym.tan.movielibrary.component.listener.MovieTitleConfirmDialogWindowListener;
import jym.tan.movielibrary.component.listener.MovieTitleConfirmListener;
import jym.tan.movielibrary.component.listener.MovieTitleConfirmTextTimerListener;
import jym.tan.movielibrary.component.listener.RestartListener;
import jym.tan.movielibrary.component.listener.ShowFolderChooserListener;
import jym.tan.movielibrary.component.listener.SingleMovieAddListener;
import jym.tan.movielibrary.component.listener.ThemeComboBoxListener;

public class ListenerFactory {
	private static SingleMovieAddListener singleMovieAddListener;
	private static ShowFolderChooserListener showFolderChooserListener;
	private static MovieTitleConfirmTextTimerListener movieTitleConfirmTextTimerListener;
	private static MovieTitleConfirmDialogWindowListener movieTitleConfirmDialogWindowListener;
	private static MovieTitleConfirmListener movieTitleConfirmListener;
	private static ThemeComboBoxListener themeComboBoxListener;
	private static RestartListener restartListener;
	private static MovieSearchResultTableSelectionListener movieSearchResultTableSelectionListener;
	
	public static synchronized SingleMovieAddListener getSingleMovieAddListener() {
		if(singleMovieAddListener == null) {
			singleMovieAddListener = new SingleMovieAddListener();
		}
		return singleMovieAddListener;
	}

	public static synchronized ShowFolderChooserListener getShowFolderChooserListener() {
		if(showFolderChooserListener == null) {
			showFolderChooserListener = new ShowFolderChooserListener();
		}
		return showFolderChooserListener;
	}

	public static synchronized MovieTitleConfirmTextTimerListener getMovieTitleConfirmTextTimerListener() {
		if(movieTitleConfirmTextTimerListener == null) {
			movieTitleConfirmTextTimerListener = new MovieTitleConfirmTextTimerListener();
		}
		return movieTitleConfirmTextTimerListener;
	}

	public static synchronized MovieTitleConfirmDialogWindowListener getMovieTitleConfirmDialogWindowListener() {
		if(movieTitleConfirmDialogWindowListener == null) {
			movieTitleConfirmDialogWindowListener = new MovieTitleConfirmDialogWindowListener();
		}
		return movieTitleConfirmDialogWindowListener;
	}

	public static synchronized MovieTitleConfirmListener getMovieTitleConfirmListener() {
		if(movieTitleConfirmListener == null) {
			movieTitleConfirmListener = new MovieTitleConfirmListener();
		}
		return movieTitleConfirmListener;
	}

	public static synchronized ThemeComboBoxListener getThemeComboBoxListener() {
		if(themeComboBoxListener == null) {
			themeComboBoxListener = new ThemeComboBoxListener();
		}
		return themeComboBoxListener;
	}

	public static synchronized RestartListener getRestartListener() {
		if(restartListener == null) {
			restartListener = new RestartListener();
		}
		return restartListener;
	}

	public static synchronized MovieSearchResultTableSelectionListener getMovieSearchResultTableSelectionListener() {
		if(movieSearchResultTableSelectionListener == null) {
			movieSearchResultTableSelectionListener = new MovieSearchResultTableSelectionListener();
		}
		return movieSearchResultTableSelectionListener;
	}
}
